package com.sihan.framework.etm.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.framework.model.BaseModel;
import com.framework.mybatis.annotation.AutoGenerator;
import com.framework.mybatis.enums.IdType;

import java.io.Serializable;

import javax.persistence.*;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * 角色表
 */
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Table(name = "jdx_role")
public class Role extends BaseModel implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 * 角色ID
	 */
	@Id
	@Column(name = "ID")
	@GeneratedValue(strategy = GenerationType.AUTO)
	@AutoGenerator(idType = IdType.UUID32)
	private String id;

	/**
	 * 角色名称
	 */
	private String name;

	/**
	 * 角色标识
	 */
	private String identify;

	/**
	 * 是否可用：0 不可用；1可用；默认为1
	 */
	private Short available;
	/**
	 * 备注
	 */
	private String remarks;

	@JsonIgnore
	private Boolean isDelete;
	@JsonIgnore
	private Boolean isDefault;

	public Role(Boolean isDelete) {
		this.isDelete = isDelete;
	}

	public Role(String id, Boolean isDelete) {
		this.id = id;
		this.isDelete = isDelete;
	}
}
